package com.sh.data.engine.common.constants;

import java.util.regex.Pattern;

/**
 * @author tyf
 * @Description:
 * @date 2020-06-1910:14
 */
public interface MapReduceConstants {

    // hadoop --config $HADOOP_HOME/conf jar <path_to_jar> <main_class> -libjars $LIB_JARS <program_arguments>

    Pattern P_HADOOP_JAR = Pattern.compile(
        "^\\s*hadoop\\s+(--config\\s+[\\$\\w\\-\\/]+\\s*)?jar\\s+[\\w\\.\\-]+\\.jar\\s+[\\$\\w\\.]+\\s*(-libjars\\s+[\\$\\w\\-\\/\\.,]+)?(\\s+[\\$\\w\\-\\/\\.,]+\\s*)*",
        Pattern.CASE_INSENSITIVE);

    Pattern P_JAR = Pattern.compile("jar\\s+(.+?\\.jar)", Pattern.CASE_INSENSITIVE);

    String HDFS_USERNAME = "hdfs";

    String HADOOP_JAR_CMD = "hadoop_jar";

    String ENV_VAR_LIBJARS_KEY = "-libjars";

    String ENV_VAR_LIBJARS_VAL = "$LIB_JARS";

}
